package org.yefei.homeworkday07;

public class HomeWorkTwo {

	public static void main(String[] args) {
		// 2：百钱买白鸡问题：一百元钱买100只鸡，大公鸡5元一只，母鸡3元一只，鸡苗一元三只,有多少种买法
		int i, j, k;
		for (i = 0; i <= 20; i++) {
			for (j = 0; j <= 33; j++) {
				k = 100 - i - j;
				if (k % 3 == 0 && 5 * i + 3 * j + k / 3 == 100) {
					System.out.println(i + "只公鸡，" + j + "只母鸡，" + k + "只鸡苗");
				}
			}
		}
	}
}
